<?php


class query_mysql
{
    public function query_sql($sql_txt,$index){
        $conn=mysqli_connect('127.0.0.1','root','123456','tpp');
        $result=mysqli_query($conn,$sql_txt);
        $info=mysqli_fetch_array($result);
        echo $info[$index];
    }
    public function query_sql_2($sql_txt,$index){
        $conn=mysqli_connect('127.0.0.1','root','123456','tpp');
        $result=mysqli_query($conn,$sql_txt);
        $info=mysqli_fetch_array($result);
        return $info[$index];
    }
}